package com.suncaper.tddmall.mapper;

import com.suncaper.tddmall.common.model.Category;
import com.suncaper.tddmall.common.model.CategoryExample;

import java.util.List;
import java.util.Map;

import com.suncaper.tddmall.common.model.ShopPages;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface CategoryMapper {
    long countByExample(CategoryExample example);

    int deleteByExample(CategoryExample example);

    int deleteByPrimaryKey(String cId);

    int insert(Category record);

    int insertSelective(Category record);

    List<Category> selectByExample(CategoryExample example);

    Category selectByPrimaryKey(String cId);

    int updateByExampleSelective(@Param("record") Category record, @Param("example") CategoryExample example);

    int updateByExample(@Param("record") Category record, @Param("example") CategoryExample example);

    int updateByPrimaryKeySelective(Category record);

    int updateByPrimaryKey(Category record);

    //categoty跟goods表联合查询
    List<Map> searchByPrice(Integer maxPrice, Integer minPrice);

    //    //通过关键字查询
    List<Category> searchByKeywords(String keywords);

    //    //记录查询数量
   Integer countSearchByKeywords(String keywords);
//    //分页查询
    List<Category> searchByPageLimit(@Param("keywords") String keywords, @Param("totalPage") Integer totalPage);

}